<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>$Title$</title>
    <script src="${pageContext.request.contextPath}/static/js/jquery-3.4.1.js"></script>
    <script>
        function a(){
            $("#content").load("/a5",{'name':123},function (data,status,xhr){
                alert(data)
                alert(status)
                alert(xhr)
                })
            $.get("static/resource/ajax",function (data,status){
                alert("文本："+data+","+"状态："+status)
            })
            $.get("${pageContext.request.contextPath}/a2",function (data,status){
                alert("文本："+data+","+"状态："+status)
                var html="";
                for (let i = 0; i <data.length ; i++) {
                    html += "<tr>" +
                        "<td>" + data[i].name + "</td>" +
                        "<td>" + data[i].age + "</td>" +
                        "<td>" + data[i].sex + "</td>" +
                        "</tr>"
                }
                $("#content").html(html);
            })
            $.post("/a1",{"pwd1":123,"pwd2":124},function (data){
                alert(data)
            })
        }
    </script>
</head>
<body>
<input type="button" id="btn" value="获取数据" onclick="a()">
<table width="80%" align="center">
    <tr>
        <td>姓名</td>
        <td>年龄</td>
        <td>性别</td>
    </tr>
    <tbody id="content"></tbody>
</table>
</body>
</html>
